package com.mapper;

import com.pojo.TongZhi;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface TongZhiMapper {
    @Select("select * from tongzhi_chen")
    List<TongZhi> selectAll();

    @Delete("delete from tongzhi_chen where id=#{id}")
    Integer delete(TongZhi tongZhi);

    @Select("select *from tongzhi_chen where title LIKE concat ('%',#{title},'%')")
    List<TongZhi> selectmh(TongZhi tongZhi);

    @Insert("INSERT INTO tongzhi_chen(title,context,time,img) values (#{title},#{context},#{time},#{img})")
    Integer insert(TongZhi tongZhi);

    @Update("UPDATE tongzhi_chen SET title = #{title}, context = #{context}, time = #{time}, img = #{img} WHERE id =#{id};")
    Integer update(TongZhi tongZhi);
}
